<?php
/**
 * This file is part of PHPlaza (http://code.google.com/p/phplaza)
 * This file is licensed under the GNU Lesser General Public License
 *      http://www.gnu.org/licenses/lgpl.html
 *
 * No warranty is given, express or implied. Use at your own risk.
 */

namespace core::services::render;
use core::services::render::html as html;
class HTMLRenderService extends AbstractRenderService
{
	private $buffer;
		
	public function getData()
	{
		return $this->buffer;
	}
			
	public function addData($data)
	{
		$this->buffer .= "\n" . $data;
	}
	
	public function getRendererByType($type, core::components::Component $component)
  {
  	switch($type)
   	{
   		case parent::PAGE:
     		return new html::Page($this, $component);
     	
     	case parent::TEXTCOMPONENT:
     		return new html::TextComponent($this, $component);
     		
     	case parent::FORM:
     		return new html::Form($this, $component);
     		
     	case parent::BUTTON:
     		return new html::Button($this, $component);
   	}
  }
}